import java.util.Scanner;

public class text3 {
    public static void fun3(int n){
       if(n<10){
           System.out.println(n);
           return;
       }
       fun3(n/10);
        System.out.println(n%10);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        fun3(n);
        sc.close();
    }
}
